package com.cloudcreativity.blyg.entity;

import com.cloudcreativity.blyg.utils.StrUtils;

public class Orders {
    private String orderNo;
    private int orderId;
    private int shouldPay;
    private int payId;
    private String orderCreateTime;
    private int totalMoney;
    private int shopId;
    private int discountMoney;
    private int actualPay;

    public int getPayId() {
        return payId;
    }

    public void setPayId(int payId) {
        this.payId = payId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public int getShouldPay() {
        return shouldPay;
    }

    public void setShouldPay(int shouldPay) {
        this.shouldPay = shouldPay;
    }

    public String getOrderCreateTime() {
        return orderCreateTime;
    }

    public void setOrderCreateTime(String orderCreateTime) {
        this.orderCreateTime = orderCreateTime;
    }

    public int getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(int totalMoney) {
        this.totalMoney = totalMoney;
    }

    public int getShopId() {
        return shopId;
    }

    public void setShopId(int shopId) {
        this.shopId = shopId;
    }

    public int getDiscountMoney() {
        return discountMoney;
    }

    public void setDiscountMoney(int discountMoney) {
        this.discountMoney = discountMoney;
    }

    public int getActualPay() {
        return actualPay;
    }

    public void setActualPay(int actualPay) {
        this.actualPay = actualPay;
    }

    public String formatTotal(){
        return String.valueOf(StrUtils.get2BitDecimal(totalMoney/100f));
    }

    public String formatDiscount(){
        return String.valueOf(StrUtils.get2BitDecimal(discountMoney/100f));
    }

    public String formatActual(){
        return String.valueOf(StrUtils.get2BitDecimal(actualPay/100f));
    }

    public String formatPay(){
        switch (payId){
            case 1:return "现金";
            case 2:return "微信";
            case 3:return "支付宝";
            case 4:return "银行卡";
            default:return "未知";
        }
    }
}
